import axios from 'axios'
import { IResp } from '../interfaces'

const localhostRequest = axios.create({
    baseURL: '/localhost-devServer',
})

localhostRequest.interceptors.response.use(
    (response) => {
        return response.data
    },
    (error) => {
        return Promise.reject(error)
    }
)
export const isDevlopment = async () => {
    return localhostRequest.get<any, IResp>('/isDevlopment')
}

export const createCaseApi = async (caseKey: string) => {
    return localhostRequest.get<any, IResp>('/createCase', {
        params: {
            caseKey
        }
    })
}

export const boardSave = async (data: any) => {
    if (!data) return
    return localhostRequest.post<any, IResp>('/boardSave', data)
}

